import java.io.IOException;
import java.math.BigInteger;

public class Main {

	/**
	 * @param args
	 * @throws IOException
	 * @throws NumberFormatException
	 */
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		java.io.BufferedReader r = new java.io.BufferedReader(
				new java.io.InputStreamReader(System.in));

		for (int i = 0; i < 10; i++) {
			BigInteger a = new BigInteger(r.readLine().trim());
			BigInteger b = new BigInteger(r.readLine().trim());
			BigInteger klaudia = a.add(b).divide(new BigInteger("2"));
			System.out.println(klaudia.toString());
			System.out.println(klaudia.subtract(b).toString());
		}
	}

}
